import React, { lazy } from 'react';

const Home = lazy(() => import('../pages/Home'))
const Login = lazy(() => import('../pages/Login'))
const Edit = lazy(() => import('../pages/Edit'))

const My = lazy(() => import('../pages/home/My'))
const MyInfo = lazy(() => import('../pages/home/MyInfo'))
const Main = lazy(() => import('../pages/home/Main'))
const Detail = lazy(() => import('../pages/home/Detail'))

const routes = [
    {
        path: '/',
        element: <Home />,
        children: [
            {
                path: "/my",
                element: <My />
            },
            {
                path: '/myInfo',
                element: <MyInfo />
            },
            {
                path: '/main',
                element: <Main/>
            },
            {
                path: '/detail/:id',
                element: <Detail/>
            }
        ]
    },
    {
        path: '/login',
        element: <Login />
    },
    {
        path: '/edit',
        element: <Edit />
    }
]

export default routes